/*
 Navicat Premium Dump SQL

 Source Server         : MySQL9@localhost
 Source Server Type    : MySQL
 Source Server Version : 90100 (9.1.0)
 Source Host           : localhost:3306
 Source Schema         : spring-mall

 Target Server Type    : MySQL
 Target Server Version : 90100 (9.1.0)
 File Encoding         : 65001

 Date: 19/05/2025 07:19:57
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for cart_item
-- ----------------------------
DROP TABLE IF EXISTS `cart_item`;
CREATE TABLE `cart_item` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `goods_id` bigint NOT NULL COMMENT '商品ID',
  `quantity` int NOT NULL COMMENT '商品数量',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_goods_id` (`goods_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='购物车表';

-- ----------------------------
-- Records of cart_item
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for goods
-- ----------------------------
DROP TABLE IF EXISTS `goods`;
CREATE TABLE `goods` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL COMMENT '商品名称',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '商品描述',
  `price` decimal(10,2) NOT NULL COMMENT '商品价格',
  `stock` int NOT NULL DEFAULT '0' COMMENT '库存数量',
  `category` varchar(50) DEFAULT NULL COMMENT '商品类别',
  `image_url` text COMMENT '商品图片URL',
  `status` tinyint DEFAULT '1' COMMENT '商品状态：1-上架，0-下架',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商品表';

-- ----------------------------
-- Records of goods
-- ----------------------------
BEGIN;
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (1, 'iPhone 15 Pro', '苹果最新旗舰手机', 8999.00, 100, '手机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 08:45:52');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (2, '小米13 Pro', '小米旗舰手机', 4999.00, 200, '手机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (3, '华为Mate 60 Pro', '华为旗舰手机', 6999.00, 150, '手机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (4, '三星Galaxy S23', '三星旗舰手机', 5999.00, 180, '手机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (5, 'OPPO Find X6', 'OPPO旗舰手机', 4499.00, 120, '手机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (6, 'vivo X90 Pro', 'vivo旗舰手机', 4999.00, 160, '手机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (7, '荣耀Magic5 Pro', '荣耀旗舰手机', 4699.00, 140, '手机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (8, '一加11', '一加旗舰手机', 3999.00, 90, '手机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (9, 'realme GT5', 'realme旗舰手机', 2999.00, 200, '手机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (10, '魅族20 Pro', '魅族旗舰手机', 4299.00, 80, '手机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (11, 'MacBook Pro 14', 'M2芯片笔记本电脑', 12999.00, 50, '电脑', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (12, '华为MateBook X Pro', '轻薄商务本', 9999.00, 60, '电脑', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:04');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (13, '联想ThinkPad X1', '商务笔记本电脑', 8999.00, 70, '电脑', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (14, '戴尔XPS 13', '超极本', 7999.00, 40, '电脑', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (15, '华硕ROG幻16', '游戏本', 10999.00, 30, '电脑', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (16, '惠普Spectre x360', '二合一笔记本', 8999.00, 45, '电脑', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (17, '小米笔记本Pro', '小米笔记本', 6999.00, 80, '电脑', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (18, '微软Surface Laptop', '微软笔记本', 8999.00, 35, '电脑', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (19, '雷蛇灵刃14', '游戏本', 11999.00, 25, '电脑', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (20, '机械革命蛟龙16', '游戏本', 7999.00, 40, '电脑', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (21, 'iPad Air', '轻薄高性能平板电脑', 4799.00, 80, '平板', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (22, '三星Galaxy Tab S9', '安卓旗舰平板', 5999.00, 70, '平板', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (23, '华为MatePad Pro', '华为旗舰平板', 4299.00, 90, '平板', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (24, '小米平板6 Pro', '小米旗舰平板', 2999.00, 120, '平板', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (25, '联想小新Pad Pro', '联想旗舰平板', 2499.00, 100, '平板', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (26, '荣耀平板V8 Pro', '荣耀旗舰平板', 2599.00, 85, '平板', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (27, 'OPPO Pad 2', 'OPPO旗舰平板', 2999.00, 75, '平板', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (28, 'vivo Pad 2', 'vivo旗舰平板', 2999.00, 65, '平板', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (29, '微软Surface Pro 9', '微软二合一平板', 8999.00, 40, '平板', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (30, 'realme Pad 2', 'realme平板', 1999.00, 110, '平板', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (31, 'Apple Watch Series 9', '最新款智能手表', 2999.00, 150, '智能手表', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (32, '华为Watch GT 4', '运动健康手表', 1599.00, 120, '智能手表', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (33, '小米手表S2', '小米智能手表', 999.00, 200, '智能手表', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (34, 'OPPO Watch 3', 'OPPO智能手表', 1499.00, 100, '智能手表', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (35, '三星Galaxy Watch6', '三星智能手表', 1999.00, 80, '智能手表', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (36, '荣耀手表4', '荣耀智能手表', 999.00, 150, '智能手表', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (37, '华米Amazfit GTR4', '华米智能手表', 1299.00, 90, '智能手表', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (38, '佳明Forerunner 265', '专业运动手表', 3299.00, 60, '智能手表', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (39, '小天才Z8', '儿童智能手表', 1999.00, 70, '智能手表', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (40, 'dido E56S', '健康监测手表', 599.00, 180, '智能手表', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (41, 'AirPods Pro', '主动降噪无线耳机', 1999.00, 200, '耳机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (42, '索尼WH-1000XM5', '头戴式降噪耳机', 2499.00, 100, '耳机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (43, 'Bose QuietComfort 45', '头戴式降噪耳机', 2299.00, 80, '耳机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (44, '华为FreeBuds Pro 3', '真无线降噪耳机', 1499.00, 150, '耳机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (45, '小米Buds 4 Pro', '真无线降噪耳机', 999.00, 180, '耳机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (46, 'OPPO Enco X2', '真无线降噪耳机', 899.00, 120, '耳机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (47, 'vivo TWS 3 Pro', '真无线降噪耳机', 999.00, 100, '耳机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (48, '荣耀Earbuds 3 Pro', '真无线降噪耳机', 899.00, 130, '耳机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (49, '森海塞尔Momentum 4', '头戴式降噪耳机', 2999.00, 60, '耳机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (50, '漫步者NeoBuds Pro 2', '真无线降噪耳机', 799.00, 160, '耳机', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (51, '小米智能门锁', '指纹密码锁', 1299.00, 100, '智能家居', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (52, '华为智能音箱', '智能语音助手', 399.00, 200, '智能家居', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (53, '石头扫地机器人T8', '扫拖一体机器人', 2999.00, 80, '智能家居', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (54, '米家空气净化器Pro', '空气净化器', 1299.00, 120, '智能家居', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (55, '华为智选台灯', '智能台灯', 199.00, 300, '智能家居', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (56, '小米智能摄像头', '家用监控摄像头', 299.00, 150, '智能家居', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (57, '绿米智能窗帘', '电动窗帘', 799.00, 90, '智能家居', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (58, '华为智选智能插座', '智能插座', 99.00, 400, '智能家居', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (59, '米家智能网关', '智能家居网关', 199.00, 200, '智能家居', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (60, '华为智选智能门铃', '智能门铃', 399.00, 120, '智能家居', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (61, 'PlayStation 5', '索尼游戏主机', 4299.00, 50, '游戏设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (62, 'Xbox Series X', '微软游戏主机', 3999.00, 40, '游戏设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (63, 'Nintendo Switch OLED', '任天堂游戏机', 2099.00, 100, '游戏设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (64, 'Steam Deck', '掌上游戏机', 3999.00, 30, '游戏设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (65, '罗技G Pro X', '游戏耳机', 1299.00, 80, '游戏设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (66, '雷蛇黑寡妇V3', '机械键盘', 899.00, 120, '游戏设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (67, '罗技G502', '游戏鼠标', 399.00, 200, '游戏设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (68, 'Xbox手柄', '游戏手柄', 459.00, 150, '游戏设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (69, 'PS5手柄', '游戏手柄', 529.00, 100, '游戏设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (70, '任天堂Pro手柄', '游戏手柄', 459.00, 80, '游戏设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (71, '索尼A7M4', '全画幅微单相机', 16999.00, 30, '摄影器材', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (72, '佳能EOS R6', '全画幅微单相机', 15999.00, 25, '摄影器材', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (73, '富士X-T5', 'APS-C画幅相机', 11999.00, 40, '摄影器材', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (74, '尼康Z6II', '全画幅微单相机', 13999.00, 35, '摄影器材', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (75, '大疆Mavic 3', '专业航拍无人机', 13888.00, 20, '摄影器材', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (76, 'GoPro Hero 11', '运动相机', 3499.00, 60, '摄影器材', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (77, 'Insta360 X3', '全景相机', 2999.00, 50, '摄影器材', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (78, '索尼ZV-1', 'Vlog相机', 4999.00, 70, '摄影器材', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (79, '佳能G7X Mark III', 'Vlog相机', 5299.00, 45, '摄影器材', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (80, '大疆Pocket 2', '口袋云台相机', 2499.00, 80, '摄影器材', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (81, '惠普LaserJet Pro', '激光打印机', 1999.00, 50, '办公设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (82, '爱普生L3158', '墨仓式打印机', 1299.00, 80, '办公设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (83, '兄弟DCP-T725DW', '一体机', 1499.00, 60, '办公设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (84, '佳能MG3680', '喷墨打印机', 999.00, 100, '办公设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (85, '惠普DeskJet 2723', '喷墨打印机', 599.00, 120, '办公设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (86, '小米米家打印机', '照片打印机', 999.00, 90, '办公设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (87, '华为智选打印机', '激光打印机', 1299.00, 70, '办公设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (88, '联想小新打印机', '喷墨打印机', 899.00, 85, '办公设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (89, '惠普M232dw', '激光打印机', 2999.00, 40, '办公设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (90, '爱普生L4168', '墨仓式打印机', 1799.00, 55, '办公设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (91, '华为AX3 Pro', 'WiFi6路由器', 399.00, 200, '网络设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (92, '小米AX6000', 'WiFi6路由器', 599.00, 150, '网络设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (93, '华硕RT-AX86U', '电竞路由器', 1299.00, 80, '网络设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (94, 'TP-Link XDR5480', 'WiFi6路由器', 699.00, 120, '网络设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (95, '网件RAX50', 'WiFi6路由器', 1499.00, 60, '网络设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (96, '小米AX9000', '三频路由器', 999.00, 90, '网络设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (97, '华为Q6', '子母路由器', 999.00, 70, '网络设备', '1.webp', 1, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
INSERT INTO `goods` (`id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `status`, `create_time`, `update_time`) VALUES (100, '网件Orbi RBK852', 'Mesh路由器', 3999.00, 30, '网络设备', '1.webp', 0, '2025-04-10 07:22:24', '2025-05-07 09:44:05');
COMMIT;

-- ----------------------------
-- Table structure for order
-- ----------------------------
DROP TABLE IF EXISTS `order`;
CREATE TABLE `order` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `order_no` varchar(32) NOT NULL COMMENT '订单编号',
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `total_amount` decimal(10,2) NOT NULL COMMENT '订单总金额',
  `status` tinyint NOT NULL COMMENT '订单状态：0-待付款，1-待发货，2-待收货，3-已完成，4-已取消',
  `receiver_name` varchar(50) NOT NULL COMMENT '收货人姓名',
  `receiver_phone` varchar(20) NOT NULL COMMENT '收货人电话',
  `receiver_address` varchar(255) NOT NULL COMMENT '收货地址',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_order_no` (`order_no`),
  KEY `idx_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单表';

-- ----------------------------
-- Records of order
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for order_item
-- ----------------------------
DROP TABLE IF EXISTS `order_item`;
CREATE TABLE `order_item` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `order_id` bigint NOT NULL COMMENT '订单ID',
  `goods_id` bigint NOT NULL COMMENT '商品ID',
  `quantity` int NOT NULL COMMENT '商品数量',
  `price` decimal(10,2) NOT NULL COMMENT '商品单价',
  `total_price` decimal(10,2) NOT NULL COMMENT '商品总价',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_order_id` (`order_id`),
  KEY `idx_goods_id` (`goods_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单项表';

-- ----------------------------
-- Records of order_item
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `permission_name` varchar(50) NOT NULL COMMENT '权限名称',
  `permission_code` varchar(50) NOT NULL COMMENT '权限编码',
  `permission_type` tinyint NOT NULL COMMENT '权限类型：1-菜单，2-按钮，3-接口',
  `url` varchar(200) DEFAULT NULL COMMENT '接口URL',
  `method` varchar(10) DEFAULT NULL COMMENT '请求方法：GET,POST,PUT,DELETE',
  `description` varchar(200) DEFAULT NULL COMMENT '权限描述',
  `status` tinyint DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_permission_code` (`permission_code`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限表';

-- ----------------------------
-- Records of sys_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `permission_type`, `url`, `method`, `description`, `status`, `create_time`, `update_time`) VALUES (1, '查看商品列表', 'GOODS:LIST', 3, '/goods/list', 'GET', '查看商品列表接口', 1, '2025-05-18 12:23:25', '2025-05-18 12:23:25');
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `permission_type`, `url`, `method`, `description`, `status`, `create_time`, `update_time`) VALUES (2, '查看商品详情', 'GOODS:DETAIL', 3, '/goods/{id}', 'GET', '查看商品详情接口', 1, '2025-05-18 12:23:25', '2025-05-18 12:23:25');
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `permission_type`, `url`, `method`, `description`, `status`, `create_time`, `update_time`) VALUES (3, '删除商品', 'GOODS:DELETE', 3, '/goods/{id}', 'DELETE', '删除商品接口', 1, '2025-05-18 12:23:25', '2025-05-18 12:23:25');
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `role_name` varchar(50) NOT NULL COMMENT '角色名称',
  `role_code` varchar(50) NOT NULL COMMENT '角色编码',
  `description` varchar(200) DEFAULT NULL COMMENT '角色描述',
  `status` tinyint DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_role_code` (`role_code`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色表';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` (`id`, `role_name`, `role_code`, `description`, `status`, `create_time`, `update_time`) VALUES (1, '管理员', 'ADMIN', '系统管理员，拥有所有权限', 1, '2025-05-07 00:45:28', '2025-05-07 06:50:37');
INSERT INTO `sys_role` (`id`, `role_name`, `role_code`, `description`, `status`, `create_time`, `update_time`) VALUES (2, '普通用户', 'USER', '普通用户，拥有基本权限', 1, '2025-05-07 00:45:28', '2025-05-07 06:36:56');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `role_id` bigint NOT NULL COMMENT '角色ID',
  `permission_id` bigint NOT NULL COMMENT '权限ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_role_permission` (`role_id`,`permission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色权限关联表';

-- ----------------------------
-- Records of sys_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`) VALUES (1, 1, 1, '2025-05-18 12:23:25');
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`) VALUES (2, 1, 2, '2025-05-18 12:23:25');
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`) VALUES (3, 1, 3, '2025-05-18 12:23:25');
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`) VALUES (4, 2, 1, '2025-05-18 12:23:25');
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `username` varchar(50) NOT NULL COMMENT '用户名',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `real_name` varchar(50) DEFAULT NULL COMMENT '真实姓名',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  `phone` varchar(20) DEFAULT NULL COMMENT '手机号',
  `status` tinyint DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统用户表';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `email`, `phone`, `status`, `create_time`, `update_time`) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', '系统管理员', 'admin@example.com', '13800138000', 1, '2025-05-07 00:45:28', '2025-05-07 00:45:28');
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `email`, `phone`, `status`, `create_time`, `update_time`) VALUES (2, 'test', 'e10adc3949ba59abbe56e057f20f883e', '测试用户', 'test@example.com', '13800138001', 1, '2025-05-07 00:45:28', '2025-05-07 00:45:28');
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `email`, `phone`, `status`, `create_time`, `update_time`) VALUES (3, 'user1', 'e10adc3949ba59abbe56e057f20f883e', '普通用户1', 'user1@example.com', '13800138005', 1, '2025-05-07 00:45:28', '2025-05-07 08:32:32');
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `email`, `phone`, `status`, `create_time`, `update_time`) VALUES (4, 'user2', 'e10adc3949ba59abbe56e057f20f883e', '普通用户2', 'user2@example.com', '13800138003', 1, '2025-05-07 00:45:28', '2025-05-07 00:45:28');
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `email`, `phone`, `status`, `create_time`, `update_time`) VALUES (8, 'user3', 'e10adc3949ba59abbe56e057f20f883e', '普通用户3', 'user3@example.com', '13800138002', 1, '2025-05-13 13:58:04', '2025-05-13 13:58:04');
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `role_id` bigint NOT NULL COMMENT '角色ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_user_role` (`user_id`,`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户角色关联表';

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`, `create_time`) VALUES (1, 1, 1, '2025-05-07 00:45:28');
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`, `create_time`) VALUES (2, 2, 2, '2025-05-07 00:45:28');
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`, `create_time`) VALUES (3, 3, 2, '2025-05-07 00:45:28');
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`, `create_time`) VALUES (4, 4, 2, '2024-05-13 20:38:48');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
